package my.action.author;
import javax.servlet.http.*;

import my.controller.*;
import my.db.DAO.AuthorDAO;
import my.db.DTO.AuthenticationDTO;
import my.db.DTO.AuthorDTO;
public class AuthorEditAction implements  Action{
	 public ActionForward execute(HttpServletRequest request,HttpServletResponse response) throws Exception{
		
		 //Fields
		 	ActionForward forward=new ActionForward();	//Object forware
		 	AuthorDTO dtoAu=new AuthorDTO();//Object AuthorDTO
			AuthorDAO dao=new AuthorDAO();//Object AuthorDAO
		 	AuthenticationDTO dto=new AuthenticationDTO();//Object AuthenticationDTO	 
		 	int userid=Integer.parseInt(request.getParameter("author_id"));// return author id
		 
		 //Checking condtion 
		 	dto=dao.listAutorIfo(userid);// Getting author information
		 	request.setAttribute("read_author",dto);
		 	forward.setRedirect(false);
		 	forward.setPath("./edit_author.jsp");// call page edit author		 
	  		return forward;
		}  	
}